﻿@using System.Data
@using ZoomLa.Common
@model ZoomLa.SQLDAL.SQL.PageSetting
@{
    Model.cols = 14;
}
@functions{
    public string GetIsDone(int isdone)
    {
        if (isdone==1) { return "<span class='fa fa-check'></span>"; }
        else { return "<span class='fa fa-remove'></span>"; }
    }
    public string GetStar(int score)
    {
        string result = "";
        for (int i = 0; i < score; i++)
        {
            result += "<i class='staricon fa fa-star'></i>";
        }
        for (int i = 0; i < 5 - score; i++)
        {
            result += "<i class='staricon fa fa-star-o'></i>";
        }
        return result;
    }
    protected string GetAudit(int istrue)
    {
        if (istrue == 1) { return "<span style='color:green;'>审核通过</span>"; }
        return "<span style='color:red;'>未审核</span>";
    }
}
<table id="EGV" class="table table-striped table-bordered table-hover">
    <tr><th></th><th>ID</th><th>名称</th><th>班标</th><th>所属学校</th><th>创建人</th><th>是否毕业</th><th>星级</th><th>添加时间</th><th>审核状态</th><th>学生人数</th><th>教师人数</th><th>家长人数</th><th>操作</th></tr>
    @if (Model.itemCount > 0)
    {
        foreach (DataRow dr in Model.dt.Rows)
        {
            <tr>
                <td><input type="checkbox" name="idchk" title="" value='@dr["RoomID"]' /></td>
                <td>@dr["RoomID"]</td>
                <td><a href="ClassShow?cid=@dr["RoomID"]">@dr["RoomName"]</a></td>
                <td>@MvcHtmlString.Create(StringHelper.GetItemIcon(dr["Monitor"].ToString()))</td>
                <td>@dr["SchoolName"]</td>
                <td>@(string.IsNullOrEmpty(dr["UserName"].ToString()) ? "管理员" : dr["UserName"])</td>
                <td>@MvcHtmlString.Create(GetIsDone(DataConverter.CLng(dr["IsDone"])))</td>
                <td>@MvcHtmlString.Create(GetStar(DataConverter.CLng(dr["ClassStar"])))</td>
                <td>@DataConverter.CDate("Creation").ToString("yyyy-MM-dd HH:mm")</td>
                <td>@MvcHtmlString.Create(GetAudit(DataConverter.CLng(dr["IsTrue"])))</td>
                <td>@dr["StuCount"]</td>
                <td>@dr["TeachCount"]</td>
                <td>@dr["FamilyCount"]</td>
                <td>
                    <a href="ClassRoomShow?id=@dr["RoomID"]" title="预览" class="option_style"><span class="fa fa-eye"></span></a>
                    <a href="AddClassRoom?menu=edit&id=@dr["RoomID"]" title="修改"><span class="fa fa-pencil"></span></a>
                    <a href="javascript:;" onclick='mvcpage.del({url: "ClassRoom_Del", ids: @dr["RoomID"], confirm: "确定要删除吗？"});' class="option_style" title="删除"><i class="fa fa-trash"></i>删除</a>
                    <a href="StudentList?id=@dr["RoomID"]&stutype=1" class="option_style"><i class="fa fa-child"></i>学生列表</a>
                    <a href="StudentList?id=@dr["RoomID"]&stutype=2" class="option_style"><i class="fa fa-user"></i>教师列表</a>
                    <a href="StudentList?id=@dr["RoomID"]&stutype=3" class="option_style"><i class="fa fa-users"></i>家长列表</a>
                </td>
            </tr>
        }
    }
    else
    {
        <tr><td colspan="14">当前没有数据</td></tr>
    }
    @Html.Partial("_page", Model)
</table>